-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STY: Apply ruff/Pyflakes rules (F) #3681
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3681 +/- ##
==========================================
- Coverage 70.89% 70.84% -0.06%
==========================================
Files 1277 1277
Lines 59212 59116 -96
Branches 9799 9801 +2
==========================================
- Hits 41980 41882 -98
- Misses 16066 16067 +1
- Partials 1166 1167 +1 ☔ View full report in Codecov by Sentry. |
16453da
to
70f42d4
Compare
98ae899
to
f7fef39
Compare
nipype/algorithms/tests/test_misc.py
Outdated
@@ -8,7 +8,6 @@ | |||
|
|||
from nipype.algorithms import misc | |||
from nipype.utils.filemanip import fname_presuffix | |||
from nipype.testing.fixtures import create_analyze_pair_file_in_directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've removed a lot of fixtures from the module namespaces. This could be generally rectified by either moving or importing fixtures from nipype.testing.fixtures
into nipype.conftest
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've put them back for now.
nipype/utils/filemanip.py
Outdated
else: | ||
raise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was meant to be a for
/else
, not a try
/except
/else
. What we need to do is instead:
for ...:
try:
...
break
except FileNotFoundError as e:
err = e
...
else:
raise err
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, sleep(2)
should be skipped in the last iteration.
a1d311f
to
dc2b0ed
Compare
F401 imported but unused
F523 `.format` call has unused arguments
F541 f-string without any placeholders
F821 Undefined name I have left some occurrences, to be fixed in a later pull request.
F841 Local variable is assigned to but never used I have left a few occurrences, to be examined later.
F901 `raise NotImplemented` should be `raise NotImplementedError`
Summary
Apply Pyflakes (F) rules, except: